<template>
  <div>
    <h2>Shop模块</h2>
    <ul>
        <li v-for="item in list" :key="item.id">
            <p>商品名称：{{item.goodName}}</p>
             <p>商品价格：￥{{item.goodPrice}}</p>
              <p>商品销售量：{{item.goodSold}}</p>
        </li>
    </ul>
  </div>
</template>

<script setup>
// 导入store的响应式函数
import {storeToRefs} from 'pinia'
// 导入当前组件需要的模块
import {useShopStore} from '@/store/shop'
const shop=useShopStore();
// 解构赋值，直接将对象的属性名作为变量名使用
let {list} = storeToRefs(shop)
</script>

<style>

</style>